import { AssistForm, Response, ResponseIPageM1Spread, Responsestring } from '@/types/apiType';

import request from '../utils/request';
import { RequestConfig } from '../utils/request/type';

/**
 * @description 获取推广标识
 * @tags m-1-spread-controller
 * @summary 获取推广标识
 * @request get:/api/m1Spread/getSpreadKey
 */
export const apiM1SpreadGetSpreadKeyByGet = (
  params: { activityId: number; goodsId: number },
  config?: RequestConfig
) =>
  request
    .get<Responsestring>(`/api/m1Spread/getSpreadKey`, params, config)
    .then((res) => res?.result);

/**
 * @description m2助力查询
 * @tags m-1-spread-controller
 * @summary m2助力查询
 * @request get:/api/m1Spread/list
 */
export const apiM1SpreadListByGet = (
  params: { activityId: number; goodsId: number; pageNo?: number; pageSize?: number },
  config?: RequestConfig
) =>
  request
    .get<ResponseIPageM1Spread>(`/api/m1Spread/list`, params, config)
    .then((res) => res?.result);

/**
 * @description m2助力
 * @tags m-1-spread-controller
 * @summary m2助力
 * @request post:/api/m1Spread/m2Assist
 */
export const apiM1SpreadM2AssistByPost = (params: AssistForm, config?: RequestConfig) =>
  request.post<Response>(`/api/m1Spread/m2Assist`, params, config).then((res) => res?.result);
